﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyQuangCao
{
    public partial class frmQC_4 : Form
    {
        public frmQC_4()
        {
            InitializeComponent();
        }
        private DataSet ds = new DataSet();
        private void setdata()
        {
            string sql = "select kh.Ten_Khach,kh.So_Dien_Thoai,kh.Chiet_Khau,dkqc.Ma_Loai,dkqc.Gia_Mot_Ky,dkqc.So_Ky_Dang,dkqc.Ngay_Bat_Dau from KhachHang kh inner join DangKyQuangCao dkqc on kh.Ma_Khach=dkqc.Ma_Khach";
            frmChinh.me.cn1.laydulieu(sql, frmChinh.me.sqlcon, ds, "dangkyquangcao");
            sql = "select * from khachhang";
            frmChinh.me.cn1.laydulieu(sql, frmChinh.me.sqlcon, ds, "khachhang");
            DataRelation dr = new DataRelation("kh_dkqc", ds.Tables["khachhang"].Columns["ma_khach"], ds.Tables["dangkyquangcao"].Columns["ma_khach"]);
            ds.Relations.Add(dr);
            cbKH.DataSource = ds;
            cbKH.DisplayMember = "khachhang.ten_khach";
            cbKH.ValueMember = "khachhang.ma_khach";
            dataGridView1.DataSource = ds;
            dataGridView1.DataMember = "khachhang.kh_dkqc";
        }
        private void btnSearch_Click(object sender, EventArgs e)
        {

        }

        private void frmQC_4_Load(object sender, EventArgs e)
        {

        }
    }
}
